
using System.ComponentModel;

namespace Bindings.Tests
{
    public class MyObject : INotifyPropertyChanged, INotifyPropertyChanging
    {
        private readonly TrackedProperty<object> someSimpleProperty;


        public event PropertyChangedEventHandler PropertyChanged = (sender, args) => { };
        public event PropertyChangingEventHandler PropertyChanging = (sender, args) => { };


        public MyObject()
        {
            someSimpleProperty = new TrackedProperty<object>("SomeSimpleProperty", OnPropertyChanged, OnPropertyChanging);
        }


        public object SomeSimpleProperty
        {
            get { return someSimpleProperty.Get(); }
            set { someSimpleProperty.Set(value); }
        }


        public void OnPropertyChanged(object sender, PropertyChangedEventArgs args)
        {
            PropertyChanged(this, new PropertyChangedEventArgs(args.PropertyName));
        }


        public void OnPropertyChanging(object sender, PropertyChangingEventArgs args)
        {
            PropertyChanging(this, new PropertyChangingEventArgs(args.PropertyName));
        }
    }
}